package junyi.power;

import junyi.SSAKObject;
import junyi.power.effects.EffectSource;

/**
 * User: Junyi BEI
 * Date: 12-9-30
 * Time: 下午1:54
 */
public abstract class Action extends SSAKObject {
  public final static int ACTION_SUCCESS = 1;
  public final static int ACTION_EXCEPTION = 0;
  public final static int ACTION_FAILURE = -1;
  public final static int ACCEPT_NONE = -2;
  public final static int ACCEPT_FAILURE = -1;
  public final static int ACCEPT_UNDETERMINED = 0;
  public final static int ACCEPT_SUCCESS = 1;
  public final static int ACCEPT_ANY = 2;
  protected EffectSource effectSource;

  public Action(EffectSource es) {
    effectSource = es;
  }

  protected boolean toContinue(int r, int a) {
    if(a == ACCEPT_ANY) {
      return true;
    }
    if(a == ACCEPT_NONE) {
      return false;
    }
    return a == r;
  }

  public abstract int start(int c);

  public EffectSource getEffectSource() {
    return effectSource;
  }

  public void setEffectSource(EffectSource effectSource) {
    this.effectSource = effectSource;
  }
}
